﻿#ifndef MENUCONTROLLER_H
#define MENUCONTROLLER_H

#include <httpcontroller.h>
using namespace stefanfrings;

class MenuController : public HttpController
{
public:
    explicit MenuController(QObject *parent = nullptr);
    ~MenuController();
    void route(QString path, QString method, HttpRequest &request, HttpResponse &response) override;
private:
    void getAll(HttpRequest &request, HttpResponse &response);
    void getList(HttpRequest &request, HttpResponse &response);
    void isMenuNameExists(HttpRequest &request, HttpResponse &response);
    void isMenuPathExists(HttpRequest &request, HttpResponse &response);
    void saveOne(HttpRequest &request, HttpResponse &response,uint64_t id=0);
    void deleteOne(uint64_t id, HttpResponse &response);

};

#endif // MENUCONTROLLER_H
